# -*- coding: utf-8 -*- 
import re
import logging

def application(environ, start_response):
    status = '200 OK'
    response_headers = [('Content-type','text/html')]
    start_response(status, response_headers)
    l = environ['PATH_INFO'].split('/',2)
    if len(l) >= 3 and re.match('^[a-zA-Z]\w*?$',l[1]) and re.match('^[a-zA-Z]\w*?$',l[2]):
        c = l[1]
        d = l[2]
        exec 'from ' + c + ' import ' + d +' as f'
        return f(environ)
    else:
        return ['error']